<?php
namespace app\index\controller;
use think\Controller;
use think\captcha\Captcha;//验证码
class Index extends Controller
{

    //判断用户是否登录
//    public function __construct()
//    {
//        parent::__construct();
//        if(empty(session('user')))
//        {
//            $msg = [];
//            $msg['result'] = 3;//session判断专用值
//            $msg['tips'] = '对不起,您还没有登录!请先登录!';
//
//            $msg = json_encode($msg,320);
//            echo $msg;  //返回前端告诉前端跳转回登录页
//
//
//        }
//
//    }


    public function Hometotal(){

        echo $this->fetch(TEM_HTML.'hometotal.html');
    }

    public function Login(){

        exit($this->fetch(TEM_HTML.'login.html'));
    }


    //容器
    public function Home(){
        $this->assign('name',session('user'));
        return  view(TEM_HTML.'index.html');
    }
    public function Homepage(){
       echo $this->fetch(TEM_HTML.'homepage.html');
    }
    public function Addapp(){
        echo $this->fetch(TEM_HTML.'add_app.html');
    }
    public function AppList(){
        echo $this->fetch(TEM_HTML.'applist.html');
    }
    public function MajiaList(){
        echo $this->fetch(TEM_HTML.'majiaList.html');
    }
    public function ChannelManage(){
        echo $this->fetch(TEM_HTML.'channelManage.html');
    }
    public function ChannelAdd(){
        echo $this->fetch(TEM_HTML.'channelAdd.html');
    }
    public function Userlist(){
        echo $this->fetch(TEM_HTML.'userlist.html');
    }
    public function PushMsg(){
        echo $this->fetch(TEM_HTML.'pushMsg.html');
    }
    public function PushList(){
        echo $this->fetch(TEM_HTML.'pushList.html');
    }
    public function ChannelTotal(){
        echo $this->fetch(TEM_HTML.'channelTotal.html');
    }
    public function ProductTotal(){
        echo $this->fetch(TEM_HTML.'productTotal.html');
    }
    public function TrafficTotal(){
        echo $this->fetch(TEM_HTML.'trafficTotal.html');
    }
    public function OpratalTotal(){
        echo $this->fetch(TEM_HTML.'opratalTotal.html');
    }
    public function AdminList(){
        echo $this->fetch(TEM_HTML.'adminList.html');
    }
    public function AdminAdd(){
        echo $this->fetch(TEM_HTML.'adminAdd.html');
    }
    public function Feedback(){
        echo $this->fetch(TEM_HTML.'feedback.html');
    }
    public function ChangePassword(){
        echo $this->fetch(TEM_HTML.'changePassword.html');
    }
    public function BlockUrlBind(){
        echo $this->fetch(TEM_HTML.'BlockUrlBind.html');
    }
    public function PhoneSlide(){
        echo $this->fetch(TEM_HTML.'phoneSlide.html');
    }
    public function ClearCache(){
        echo $this->fetch(TEM_HTML.'clearCache.html');
    }

    public function test(){
        $res = db('account')->where(['username'=>'falcon'])->find();
        dump($res);die;
    }
}
